<h1 class="right">تقارير سندات الصرف</h1>

<div class="clear"></div>

<div id="dashboard-container">
	<div class="customers-filter">
    	<table class="bookings-filter">
        	<form name="contract_search" action="" method="POST" id="searchClient">
          <tr>
            
            	<td style="width:20px;">من  </td>
                <td >
                  <input type="text" class="small-input" name="from" id="from" placeholder=""  value="<?php if(isset($binds['from']) ) {echo $binds['from'];} ?>"/>
                </td>
                <td>
                </td>
                <td>الى</td>
                <td><input type="text" class="small-input" name="to" id="to" placeholder="" value="<?php if(isset($binds['to']) ) {echo $binds['to'];} ?>" /></td>
                <td style="width:100px;">رقم العقد / الحجز</td>
                <td style="width:60px; padding-left:20px;"><input type="text" class="auto-input" name="contract_id" value="<?php if(isset($binds['contract_id']) ) {echo $binds['contract_id'];} ?>"></td>
                <td style="width:60px;">رقم السند</td>
                <td style="width:70px; padding-left:20px;"><input type="text" class="xsmall-input" name="payment_id" value="<?php if(isset($binds['payment_id']) ) {echo $binds['payment_id'];} ?>"></td>
                <input type="hidden" id="page" name="page" value="" />
                <td >طريقة الدفع:&nbsp;
                  <select class="small-select" name="payment_method" style="width:80px;">
                    <?php if( isset($binds['payment_method']) && $binds['payment_method'] == 0){ ?>
                    <option selected="selected" value="0">نقدى</option>
                    <?php }else{ ?>
                    <option value="0">نقدى</option>
                    <?php }if(isset($binds['payment_method']) && $binds['payment_method'] == 1){ ?>
                    <option selected="selected" value="1">حوالة بنكية</option>
                    <?php }else{ ?>
                    <option value="1">حوالة بنكية</option>
                    <?php } ?>
                  </select>
                </td>
                <td style="width:50px"><div class="search-botton">بحث</div></td>
            </tr>
            </form>
      </table>
    </div>
    
    
    <div class="dashboard-row">
    
    	<table class="customers-table">
            <tr class="customers-table-head">
            	<td width="">رقم السند</td>
              <td width="">إلى السيد</td>
              <td width="">التاريخ الميلادى</td>
              <td width="">التاريخ الهجرى</td>
              <td width="">المبلغ</td>
              <td width="">من أجل</td>
              <td width="">طريقة الدفع</td>
              <td width="">رقم العقد</td>
              <td width="">أمين الصندوق </td>
            </tr>
            <?php if(!empty($payments)) { ?>
            <?php foreach($payments as $payment) {?>
                <tr class="">
                    <td width=""><?php echo $payment['payment_id']; ?></td>
                    <td class="blue" width=""><?php echo $payment['amen_sondoq']; ?></td>
                    <td class="blue" width=""><?php echo $payment['miladi_date']; ?></td>
                    <td class="blue" width=""><?php echo $payment['Hijri_date']; ?></td>
                    <td width=""><?php echo $payment['amount']; ?></td>
                    <td width=""><?php echo $payment['reason']; ?></td>
                    <td width=""><?php echo $payment['paymen_method']; ?></td>
                    <td class="" width="">
                      <?php echo $payment['contract_id']; ?>
                    </td>
                    <td width=""> <?php echo $payment['amen_sondoq']; ?> </td>
                </tr>
              <?php  } 
                }else{
                  echo "<td colspan='9' class='large red' align=''>لا توجد نتائج</td>";
                }  ?>
            
        </table><br />
        <hr />
        <?php
         $start = $page * 20 -19;
          $end  = $start + 19;
          if($end > $totalPages)
            $end = $totalPages
          
        ?>
        <?php if(!empty($payments)) { ?>
        <div class="clear"></div>
        <div class="relative">
          <div id="contracts-selection" class="center"></div>
          <span class="middle xsmall showing-results absolute">عرض النتائج <?php echo $start; ?> - <?php echo $end; ?> من إجمالى <?php echo $totalPages; ?></span>
        </div> 

        <div class="hidden totalPages"><?php if(isset($totalPages)) {echo $totalPages;} ?></div>
        <div class="hidden currentPage"><?php if(isset($page)) {echo $page;} ?></div>
        <?php } ?>
    </div>
<div class="clear"></div>
</div>
            
